//引入公共文件
import '@utils/init.js';

import ajax from '@utils/ajax.js'

$('#registerBtn').click(async() => {
    let username = $(`#username`).val() + '';
    let userpass = $(`#password`).val() + '';
    const res = await ajax({
        url: '/users/register',
        type: 'POST',
        data: {
            username,
            userpass
        },
    })
    res.code ? alert('注册成功') : alert('注册失败')
})